<?php
namespace app\api\controller;

use app\common\business\Category as CategoryBus;

class Category extends ApiBase
{
    public function index()
    {

        try {
            $categoryBus = new CategoryBus();
            $categorys = $categoryBus->getNormalCategorys();
        } catch (\Exception $e) {
            return show(config('status.success'),'success',[]);
        }
        $cate = \app\common\lib\Arr::getTree($categorys);
        $cate = \app\common\lib\Arr::sliceTreeArr($cate);
        return show(0,'success', $cate);
    }
}